import Vue from 'vue'
import axios from '@/plugins/axios'
import components from '@/components'
import ImageViewer from 'element-ui/packages/image/src/image-viewer'

import {
  Button,
  Container,
  Aside,
  Header,
  Main,
  Menu,
  MenuItemGroup,
  MenuItem,
  Submenu,
  Breadcrumb,
  BreadcrumbItem,
  Dropdown,
  DropdownMenu,
  DropdownItem,
  MessageBox,
  Card,
  Form,
  FormItem,
  Input,
  Upload,
  Message,
  Loading,
  Table,
  TableColumn,
  Popconfirm,
  Dialog,
  Popover,
  Avatar,
  Tag,
  RadioGroup,
  Radio,
  Checkbox,
  CheckboxGroup,
  Pagination,
  Select,
  Cascader,
  DatePicker,
  Image,
  TimePicker,
  Option,
  Footer,
  Row,
  Col,
  Tooltip
} from 'element-ui'

Vue.use(Button)
.use(Container)
.use(Aside)
.use(Header)
.use(Main)
.use(Menu)
.use(MenuItemGroup)
.use(MenuItem)
.use(Submenu)
.use(Breadcrumb)
.use(BreadcrumbItem)
.use(Dropdown)
.use(DropdownMenu)
.use(DropdownItem)
.use(Card)
.use(Form)
.use(FormItem)
.use(Input)
.use(Upload)
.use(Table)
.use(TableColumn)
.use(Popconfirm)
.use(Dialog)
.use(Popover)
.use(Avatar)
.use(Tag)
.use(RadioGroup)
.use(Radio)
.use(CheckboxGroup)
.use(Checkbox)
.use(Pagination)
.use(Select)
.use(Cascader)
.use(DatePicker)
.use(Image)
.use(TimePicker)
.use(Option)
.use(Footer)
.use(Row)
.use(Col)
.use(Tooltip)

.use(Loading.directive)
Vue.prototype.$loading = Loading.service
Vue.prototype.$confirm = MessageBox.confirm
Vue.prototype.$message = Message

Vue.component('el-image-viewer', ImageViewer)
Vue.use(axios)
Object.keys(components).forEach(name => Vue.component(name, components[name]))
